package com.honey.mybatis.generator.page.method;

import com.honey.compilation.java.Method;
import com.honey.compilation.java.MethodDecoration;
import com.honey.compilation.java.Parameter;
import com.honey.core.types.JDKFullyQualifiedJavaType;
import com.honey.mybatis.generator.AbstractMethod;
import com.honey.mybatis.generator.page.PageConstant;

public class SetBeginMethod extends AbstractMethod {
	
	private static final String METHOD_NAME = "setBegin" ;
	
	private static final String[] JAVA_DOC = new String[]{
		"开始位置(从0开始计数)."
	}; 
	
	private static final Parameter[] PARAMETER = new Parameter[]{
		new Parameter(JDKFullyQualifiedJavaType.getIntInstance(),PageConstant.PAGE_BEGIN_FIELD_NAME,"开始位置(从0开始计数)" ),
	};
	
	@Override
	protected void addBody(Method method) {
		method.addBodyLine("this."+PageConstant.PAGE_BEGIN_FIELD_NAME+" = "+PageConstant.PAGE_BEGIN_FIELD_NAME);
	}

	@Override
	protected Parameter[] getParameter() {
		
		return PARAMETER;
	}

	@Override
	protected String getMethodName() {
		return METHOD_NAME;
	}

	@Override
	protected MethodDecoration getMethodDecoration() {
		MethodDecoration answer =  super.getMethodDecoration() ;
		answer.setFinal(true);
		return answer;
	}

	@Override
	protected String[] getJavaDoc() {
		return JAVA_DOC;
	}
	
	
}
